#define AppVersion GetEnv("APP_VERSION")
#define GSAppNameCN "PackTest"
#define GSAppName "PackTest"
#define GSAppPublisher "goldstar"
#define GSAppURL "http://www.goldstar-china.com/"
#define GSAppVerName "goldstar_PackTest"
#define GSDateTimeString GetDateTimeString('yyyy/mm/dd/hh/nn', '-' ,'');

[Setup]
AppName                 ={#GSAppName}
AppVerName              ={#GSAppVerName}{#AppVersion}
AppCopyright            =1992-2023 goldstar Software
AppPublisher            ={#GSAppPublisher}
DefaultDirName          ={pf}\{#GSAppName}
DefaultGroupName        ={#GSAppName}
Compression             =lzma
SolidCompression        =true
WizardImageFile         =goldstar.bmp
WizardSmallImageFile    =logo.bmp
UninstallDisplayIcon    ={app}\SkinHelper.exe
OutputDir               =.\Output                
OutputBaseFilename      ={#GSAppName}{#AppVersion}_{#GSDateTimeString}
VersionInfoCompany      =goldstar Software
VersionInfoDescription  ={#GSAppPublisher}
VersionInfoTextVersion  ={#AppVersion}

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";

[Files]
; Add the ISSkin DLL used for skinning Inno Setup installations.

; Add the Visual Style resource contains resources used for skinning,

[Files]
Source: "tmp_deploy\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs


[Icons]
Name: {group}\uninstall; Filename: {app}\unins000.exe
Name: {userdesktop}\{#GSAppNameCN}; Filename: {app}\{#GSAppNameCN}.exe; IconFilename: {app}\icon1.ico; Tasks: desktopicon


[run]

[UninstallRun]
;Filename: "{app}\closePrecess.bat"; Flags: waituntilterminated
;Filename: "{app}\TempAnalysisService.exe"; Parameters: "-remove"; Flags: waituntilterminated

; The following code block is used to load the ISS, pass in
; NormalBlack.ini as the second parameter to LoadSkin to use
; the Black color scheme instead of the default Blue color
; scheme.
[Code]

// Importing ShowWindow Windows API from User32.DLL
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external 'ShowWindow@user32.dll stdcall';

function InitializeSetup(): Boolean;
begin
	Result := True;
end;

procedure DeinitializeSetup();
begin
	// Hide Window before unloading skin so user does not get
	// a glimse of an unskinned window before it is closed.
	ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
end;

